<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="common_css :: commonHeader('函数管理')"></head>
<body>
<!--搜索框-->
<form method="post" id="tabfrom">
    <div style="padding:2px" class="easyui-panel" title="数据查询">
        <table class="form-table">
            <tr>
                <td align="right">所属模块：</td>
                <td>
                    <input id="selModular" name="selModular" style="width: 350px" multiple="multiple"
                           cascadeCheck="true"
                           data-options="required:false,prompt:'==请选择==',panelHeight:'auto'"
                           class="easyui-combotree"/>
                </td>
            </tr>
            <tr>
                <td align="right">所属客户：</td>
                <td>
                    <input id="selCustomer" name="selCustomer" style="width: 350px" multiple="multiple"
                           cascadeCheck="true"
                           data-options="required:false,prompt:'==请选择=='"
                           class="easyui-combotree"/>
                </td>
            </tr>
            <tr>
                <td align="right">所属报表：</td>
                <td>
                    <input id="selReport" name="selReport" style="width: 350px" multiple="multiple"
                           cascadeCheck="true"
                           data-options="required:false,prompt:'==请选择==',panelHeight:'auto'"
                           class="easyui-combotree"/>
                </td>
            </tr>
        </table>
        <table class="form-table">
            <tr>
                <td align="right" width="10%">SQL名称：</td>
                <td align="left">
                    <input id="selName" style="width:150px"/>
                </td>
                <td align="right" width="10%">中文名称：</td>
                <td align="left">
                    <input id="selChineseName" style="width:150px"/>
                </td>
                <td align="right" width="10%">数据库来源：</td>
                <td align="left">
                    <input style="width:150px" id="selDataBaseType"
                           data-options="valueField:'value',textField:'showmsg' ,panelHeight:'auto',prompt:'==请选择=='"
                           class="easyui-combobox"/>
                </td>
            </tr>
            <tr>
                <td align="right" width="10%">状态：</td>
                <td align="left">
                    <input style="width:150px" id="selStatus"
                           data-options="valueField:'value',textField:'showmsg' ,panelHeight:'auto',prompt:'==请选择=='"
                           class="easyui-combobox"/>
                </td>
                <td align="right">版本号：</td>
                <td>
                    <input style="width:150px" id="selVersion"
                           data-options="valueField:'value',textField:'showmsg' ,panelHeight:'auto',prompt:'==请选择=='"
                           class="easyui-combobox"/>
                </td>
                <td align="right" width="10%">SQL类型：</td>
                <td align="left">
                    <input style="width:150px" id="selType"
                           data-options="valueField:'value',textField:'showmsg'
                                    ,panelHeight:'auto',prompt:'==请选择=='" class="easyui-combobox"/>
                    <a class="easyui-linkbutton" iconCls='icon-search' onclick="doSearch();">查询</a>
                </td>
            </tr>
        </table>
    </div>
    <br>
</form>
<div id="toolbar">
    <shiro:hasPermission name="reportworld:datasql:add">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-add"
           onclick="addDataSql()">添加</a>
    </shiro:hasPermission>
    <shiro:hasPermission name="reportworld:datasql:edit">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-edit"
           onclick="editDataSql()">修改</a>
    </shiro:hasPermission>
    <shiro:hasPermission name="reportworld:datasql:del">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-cancel"
           onclick="delDataSql()">删除</a>
    </shiro:hasPermission>
    <shiro:hasPermission name="reportworld:datasql:update">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls='icon-cart'
           onclick="getDataUpdateInfo();">修改记录</a>
    </shiro:hasPermission>
</div>

<div id="dg"></div>


<div id="dlg" class="easyui-dialog" style="width:950px;height:610px"
     closed="true" modal="true" maximizable="true" resizable="true">
    <form id="myform" method="post">
        <div style="padding:20px">
            <table cellpadding="2px" cellspacing="0" class="form-table">
                <input type="hidden" id="id" name="id">
                <tr>
                    <td align="right">SQL名称：</td>
                    <td><input class="easyui-validatebox" name="name"/></td>
                </tr>
                <tr>
                    <td align="right">中文名称：</td>
                    <td><input class="easyui-validatebox" name="chineseName"/></td>
                </tr>
                <tr>
                    <td align="right">SQL类型：</td>
                    <td>
                        <input name="type" id="type" class="easyui-combobox" editable="false"
                               data-options="required:false,valueField:'value',textField:'showmsg',prompt:'==请选择==',panelHeight:'auto'"
                               missingMessage="请维护类型" validType="comboxValidate['type','请维护类型']"/>
                    </td>
                </tr>
                <tr>
                    <td align="right">数据库来源：</td>
                    <td align="left">
                        <input id="dataBaseType" name="dataBaseType" editable="false"
                               data-options="required:false,valueField:'value',textField:'showmsg' ,panelHeight:'auto',prompt:'==请选择=='"
                               class="easyui-combobox" validType="comboxValidate['dataBaseType','请维护数据库来源']"/>
                    </td>
                </tr>
                <tr>
                    <td align="right">状态：</td>
                    <td>
                        <input name="status" id="dataSqlStatus" class="easyui-combobox" editable="false"
                               data-options="required:false,valueField:'value',textField:'showmsg',prompt:'==请选择==',panelHeight:'auto'"
                               missingMessage="请维护状态" validType="comboxValidate['dataSqlStatus','请维护状态']"/>
                    </td>
                </tr>
                <tr>
                    <td align="right">版本号：</td>
                    <td>
                        <input name="version" id="dataSqlCheckVersion"
                               data-options="valueField:'value',textField:'showmsg' ,panelHeight:'auto',prompt:'==请选择=='"
                               class="easyui-combobox"/>
                    </td>
                </tr>
                <tr>
                    <td align="right">所属模块：</td>
                    <td>
                        <input id="modular" name="modular" style="width: 350px" multiple="multiple" cascadeCheck="true"
                               data-options="required:false,prompt:'==请选择==',panelHeight:'auto'"
                               class="easyui-combotree"
                               validType="comtreeValidate['modular','请选择所属模块']"/>
                    </td>
                </tr>
                <tr>
                    <td align="right">所属客户：</td>
                    <td>
                        <input id="customer" name="customer" style="width: 350px" multiple="multiple"
                               cascadeCheck="true"
                               data-options="required:false,prompt:'==请选择=='"
                               class="easyui-combotree"
                               validType="comtreeValidate['customer','请选择所属客户']"/>
                    </td>
                </tr>
                <tr>
                    <td align="right">所属报表：</td>
                    <td>
                        <input id="report" name="report" style="width: 350px" multiple="multiple" cascadeCheck="true"
                               data-options="required:false,prompt:'==请选择==',panelHeight:'auto'"
                               class="easyui-combotree"
                               validType="comtreeValidate['report','请选择所属报表']"/>
                    </td>
                </tr>
                <tr>
                    <td align="right">SQL语句：</td>
                    <td colspan="3">
                        <input class="easyui-textbox" name="datasql"  validType="length[10,1200000]"
                               data-options="multiline:true" style="height:350px;width:650px"/>
                    </td>
                </tr>
                <tr>
                    <td align="right">SQL说明：</td>
                    <td colspan="3">
                        <input class="easyui-textbox" name="description"
                               data-options="multiline:true" style="height:80px;width:650px"/>
                    </td>
                </tr>
            </table>
        </div>

    </form>
</div>


<!--修改信息查询-->
<div id="dlgDataDemandBug" class="easyui-dialog" style="width:750px;height:500px"
     closed="true" modal="true" maximizable="true" resizable="true" buttons="#dlg-buttonsUpdateDataSqlInfo">
    <form method="post" id="tabfromDataDemandBug">
    </form>
    <div id="dgDataDemandBug"></div>
    <input type="hidden" name="dataCodeView" id="dataCodeView"> <!--数据编码-->
    <input type="hidden" id="dataId"> <!--数据ID-->
    <div id="dlg-buttonsUpdateDataSqlInfo" style="text-align:center">
        <shiro:hasPermission name="reportworld:datasql:update:add">
            <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-add"
               onclick="addDataDemandBug()">添加</a>
        </shiro:hasPermission>
        <shiro:hasPermission name="reportworld:datasql:update:edit">
            <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-edit"
               onclick="editDataDemandBug()">修改</a>
        </shiro:hasPermission>
        <shiro:hasPermission name="reportworld:datasql:update:del">
            <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel"
               onclick="delDataDemandBug()">删除</a>
        </shiro:hasPermission>
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-back"
           onclick="$('#dlgDataDemandBug').dialog('close')">返回</a>
    </div>
</div>

<!--修改信息查询添加-->
<div id="dlgDataDemandBugView" class="easyui-dialog" style="width:600px;height:510px"
     closed="true" modal="true" maximizable="true" resizable="true">
    <form method="post" id="myformDataDemandBug">
        <div style="padding:20px">
            <table cellpadding="2px" cellspacing="0" class="form-DataSql">
                <input type="hidden" name="id" id="dataDemandBugId"> <!--关联关系表的ID-->
                <input type="hidden" name="dataId" id="dataDemandBugDataId">  <!--数据ID-->
                <input type="hidden" name="dataCode" id="dataCode"> <!--数据编码-->
                <tr>
                    <td align="right">需求/BUG编号：</td>
                    <td colspan="3">
                        <input id="demandBugInfo" ediDataSql="false" name="demandBugId" class="easyui-combobox"
                               data-options="valueField:'id',textField:'demandBugNum' ,prompt:'==请选择=='"
                               validType="checkDataDemandBug['dataDemandBugFirst','已经存在该需求BUG关系，请更换！']"/>
                        <input type="hidden" class="textbox" name="dataDemandBugFirst" id="dataDemandBugFirst"/>
                        <!--之前的-->
                    </td>
                </tr>
                <tr>
                    <td align="right">需求/BUG：</td>
                    <td colspan="3">
                        <input id="demandBugType" name="demandBugType" ediDataSql="false" disabled
                               class="easyui-combobox" data-options="prompt:'==请选择==',panelHeight:'auto', valueField: 'label', textField: 'value',
                                    data: [{ label: '1',  value: '需求' },{ label: '2', value: 'BUG'}]"
                               validType="comboxValidate['demandBugType','请选择需求还是BUG']"/>
                    </td>
                </tr>
                <tr>
                    <td align="right">说明：</td>
                    <td colspan="3">
                        <input class="easyui-textbox" name="description" id="description" disabled
                               missingMessage="请输入字段顺序！"
                               data-options="multiline:true,required:false" style="height:270px;width:350px"/>
                    </td>
                </tr>
            </table>
        </div>
    </form>
</div>


<div th:include="common_js :: commJS"></div>
<script type="text/javascript"
        th:src="@{/js/reportworld/datasql.js}"></script>
<script type="text/javascript"
        th:src="@{/js/reportworld/common.js}"></script>
</body>
</html>
